<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>药品资质管理(生产企业端)</title>
    <%@ include file="/WEB-INF/component/commonCSS.jsp" %> 
    <!--[if lt IE 9]>
        <script src="lib/js/html5shiv.min.js"></script>
        <script src="lib/js/respond.min.js"></script>
    <![endif]-->
</head>
<body class="skin-blue-light sidebar-mini fixed skin-blue-light-frame">

    <section class="content-header">
         <h1>药品资质申报</h1>
        <ol class="breadcrumb">
            <li><a href="${ctx}/home.jsp"><i class="fa fa-home"></i>首页</a></li>
            <li class="active"><a href="#">招标采购管理</a></li>
            <li class="active"><a href="#">投标药品信息管理</a></li>
            <li class="active"><a href="#">药品资质申报</a></li>
        </ol>
    </section>
    <section class="content">
        <div class=" box box-success">
            <div class="box-body">
                <div class=" form-inline">
                    <div class="form-group form-group-xs">
                     <label>药品编码：</label>
                        <input class="form-control" id="drugcode" name="drugcode" type="text" placeholder="药品编码" />
                    </div>
                     <div class="form-group form-group-xs">
                        <label>通用名：</label>
                        <input class="form-control" id="qualityspecName" name="qualityspecName" type="text" placeholder="通用名" />
                    </div>
                   
                    <button type="button" onclick="gridSerch();" class="btn btn-success btn-sm"> 查&nbsp;询</button>
                </div>
            </div>
        </div>
        <table class="jqgrid" id="gridlist"></table>
        <div id="gridpage"></div>

    </section>
    <%@ include file="/WEB-INF/component/commonJS.jsp" %> 
    <script type="text/javascript">
        
        $(function () {
            
            $("#gridlist").jqGrid({
                url: "${ctx}/prodDrugProfile/getProdDrugListDeclare.html",
                mtype: "POST",
                datatype: "json",
               // postData: { "projId" : "${projId}" },
                autowidth: true,
                shrinkToFit:false,
                height: 270,
                colNames: ['操作', 'projId', 'prodId','qualityspecId','项目名称','药品编码',  '通用名', '剂型', '规格', '转换系数', '单位','材质', '申报开始时间', '申报结束时间', '申报数', '已申报数', '未申报数'],
                colModel: [
                    { name: 'operate', width: 80 , align:"center" ,sortable: false, 
                        formatter : function(val, opts, rowdata) {
                            var str = "";
                            if(rowdata.proSubmitEndtime >= "${date}" && rowdata.proSubmitEndtime != null && rowdata.proSubmitEndtime != "" && rowdata.proSubmitStarttime != null && rowdata.proSubmitStarttime != ""   ){
                            str +="<a href='${ctx}/prodDrugProfile/toProdDrugProfileList.html?prodId=" + rowdata.prodId + "&projId=" + rowdata.projId + "' >申报</a>";
                            }
                            return str;
                            }
                    },
                    { name: 'projId', width: 100 ,hidden:true, align:"center",sortable: false},
                    { name: 'prodId', width: 100 ,hidden:true, align:"center",sortable: false},
                    { name: 'qualityspecId',hidden:true, width: 120 , align:"center",sortable: false},
                    { name: 'projName', width: 180 , align:"left",sortable: false},
                    { name: 'drugCode', width: 120 , align:"center",sortable: false},
                    { name: 'qualityspecName', width: 180 , align:"left" ,sortable: false},
                    { name: 'form', width: 80 , align:"center" ,sortable: false},
                    { name: 'spec', width: 80 , align:"left" ,sortable: false},
                    { name: 'factor', width: 80 , align:"center" ,sortable: false},
                    { name: 'unit', width: 40 , align:"center" ,sortable: false},
                    { name: 'materialName', width: 80 , align:"center" ,sortable: false},
                    { name: 'proSubmitStarttime', width: 140 , align:"center" ,sortable: false},
                    { name: 'proSubmitEndtime', width: 140 , align:"center" ,sortable: false},
                    { name: 'totalCount', width: 80 , align:"center" ,sortable: false},
                    { name: 'declaredCount', width: 80 , align:"center" ,sortable: false},
                    { name: 'undeclaredCount', width: 80 , align:"center" ,sortable: false}

                ],
                rowNum: 20,
                rowList: [10,20,50,100],
                rownumbers: true,
                pager: "#gridpage",
                //multiselect: true, 
                viewrecords: true,
                caption: "药品列表",
                jsonReader: {
                    repeatitems: false,
                    id: "ids"
                }
            });
            $("#gridlist").jqGrid('navGrid', '#gridpage', { add: false, edit: false, del: false, search: false, refresh: false });
            $(window).trigger("resize");  
            
        });
        

        //查询
        function gridSerch() {
            var drugcode = $.trim( $("#drugcode").val());
            var qualityspecName = $.trim( $("#qualityspecName").val());
            $("#gridlist").jqGrid('setGridParam',{  
                datatype:'json',
                postData:{"drugCode":drugcode,
                        "qualityspecName":qualityspecName}
            }).trigger("reloadGrid"); //重新载入  
        }
        
        

        
        
 
    </script>
</body>
</html>